import type { DialogOptions } from 'naive-ui/lib/dialog';

export interface ModalMethods {
  setProps: (props: ModalProps) => void;
  /**
   * 打开弹窗
   */
  openModal: () => void;
  /**
   * 关闭弹窗
   */
  closeModal: () => void;
  /**
   * 确认按钮Loading
   */
  setLoading: (loading: boolean) => void;
}

/**
 * 支持修改，DialogOptions 參數
 */
export type ModalProps = DialogOptions;

export type RegisterFn = (ModalInstance: ModalMethods) => void;

export type UseModalReturnType = [RegisterFn, ModalMethods];
